<template>
  <div class="body">
    <van-sticky class="nav">
      <van-nav-bar title="个性设置">
        <template #left>
          <van-icon name="arrow-left" color="#ddd" @click="$router.go(-1)" size="25px" />
        </template>
      </van-nav-bar>
    </van-sticky>
    <van-cell class="cell" is-link title="账户安全" @click="$router.push(`/updatepwd/${u_id}`)" />
    <van-cell class="cell" is-link title="地址管理" @click="show = true" />
    <van-cell class="cell" title="声音生效" @click="show = true">
      <template #value>
        <van-switch v-model="checked" active-color="#ffc94b" size="15px" />
      </template>
    </van-cell>
    <van-cell class="cell" is-link title="身份认证" @click="show = true" />
    <van-cell class="cell" is-link title="关于我们" @click="show = true" />
    <van-cell class="cell" is-link title="隐私政策" @click="show = true" />
    <van-cell class="cell" is-link title="当前版本" @click="show = true">
      <template #value>
        <div>21.8.2(最新)</div>
      </template>
    </van-cell>
    <van-cell class="cell" is-link title="清除缓存" @click="show = true">
      <template #value>
        <div>19.8M</div>
      </template>
    </van-cell>
    <van-button @click="clear()" type="primary" size="large" color="#ffc94b" style="font-size: 26px; margin: 0 10px; width: 90%; font-weight: bold; font-size: 20px;">退出登录</van-button>
  </div>
</template>

<script setup>
import router from '@/router';
import { ref} from 'vue';
import { useRoute } from 'vue-router';

const checked = ref(true);

const u_id=ref(useRoute().params.id)
//清除本地存储
function clear(){
  localStorage.clear()
  router.push('/login')
}
</script>

<style lang="scss" scoped>
.cell {
  width: 95%;
  // box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #eee;
  margin: 10px;
  border-radius: 5px;
}
</style>